﻿using System;
using System.Windows.Controls;
using jSLCore.Client.Presentation.BaseControl;
using Telerik.Windows.Controls;

namespace jSLApp.Client.Forms
{
    public partial class FileUpload : DialogControl
    {
        public FileUpload()
        {
            InitializeComponent();
        }

        private void uploaded_Started(object sender, UploadStartedEventArgs e)
        {
            
        }

        private void uploading_Starting(object sender, FileUploadStartingEventArgs e)
        {
          //Здесь можно добавить параметры для сервера
        }

        private void file_Uploaded(object sender, FileUploadedEventArgs e)
        {
            var fileName = (string)e.HandlerData.CustomData["FileNameResult"];
            
            InvokeDataSelected(fileName);
        }

       
         public override void CancelClicked()
        {
            upload.CancelUpload();
            base.CancelClicked();
        }

        public override bool IsStandartOkCancelEnabled
        {
            get { return true; }
        }

        public override object OkContent
        {
            get { return "Создать"; }
        }

        public override bool AutoSize
        {
            get { return true; }
        }
        
        public override Control GetControlForInitialFocus()
        {
            return upload;
        }


    }
}
